package com.flot.yazb.model.user;

import com.flot.yazb.base.model.BModel;
import com.flot.yazb.base.client.RetrofitFactory;
import com.flot.yazb.aop.stub.RMCallback;
import com.flot.yazb.aop.stub.RMResponse;
import com.flot.yazb.retrofit.service.BService;


public class SelfDetailModel extends BModel {

    public static void getUserMsg(String id, final Transit<SelfDetailModel> incubator) {
        RetrofitFactory.getInstance()
                .create(BService.UserService.class)
                .getSelfDetailMsg(id)
                .enqueue(new RMCallback<RMResponse<SelfDetailModel>>(incubator.getContext()) {
                    @Override
                    protected void onSuccess(RMResponse<SelfDetailModel> result) {
                        incubator.onBorn(result.content, result.code(), result.message());
                    }

                    @Override
                    protected void onFail(String errorCode, String errorInfo) {
                        incubator.onBorn(null, errorCode, errorInfo);
                    }
                });
    }

    public static void setDetailMsg(FixMsgParmsModel model, final Transit<SelfDetailModel> incubator) {
        RetrofitFactory.getInstance()
                .create(BService.UserService.class)
                .setDetailMsg(model)
                .enqueue(new RMCallback<RMResponse<SelfDetailModel>>(incubator.getContext()) {
                    @Override
                    protected void onSuccess(RMResponse<SelfDetailModel> result) {
                        incubator.onBorn(result.content, result.code(), result.message());
                    }

                    @Override
                    protected void onFail(String errorCode, String errorInfo) {
                        incubator.onBorn(null, errorCode, errorInfo);
                    }
                });
    }
    public String id;
    public String weid;
    public String mid;
    public String child;
    public String yidi;
    public String leixin;
    public String sex;
    public String fumu;
    public String meili;
    public String blank;
    public String createtime;
}
